<!-- 电子发票报表 -->
<template>
  <div class="common-body-wrapper">
    <search-header
      single-width="130"
      :searchList="searchList"
      @changeHeight="toRetTable"
      @confirmSearch="toSearch"
      @handleChange="handleSearchChange"
    ></search-header>
    <multi-fun-table
      :sortColumn="notFormatColumn"
      :orderType="sortType"
      :fixed-cols="fixedCols"
      :is-reset-table="isResetTable"
      :theads-info="theadsInfo"
      :tbodys-info="tbodysInfo"
      @handleMultiCheck="handleMultiCheck"
      @handleSortColumn="handleSortColumn"
      @searchFn="getList"
      @getNextPage="getNextPage"
    >
      <div class="operate-btn-group" slot="operateBtnGroup">
        <a
          class="ake_btn ake_btn_text"
          v-if="isPermmited('USER_INVOICE:INVOICE_FORM:EXPORT')"
          @click.prevent="exportData()"
        >导出</a>
      </div>
      <template slot="tdCell" slot-scope="props">
        <el-table-column
          :fixed="props.fixed"
          :label="props.label"
          :min-width="props.minWidth"
          :width="props.width"
          :prop="props.prop"
          :sortable="props.sortable"
        >
          <template slot-scope="scope">
            <span v-if="'reno' == props.prop&&scope.$index!==0">{{ scope.$index }}</span>
            <span v-else-if="'reno' == props.prop&&scope.$index==0">合计</span>
            <span v-else>{{ scope.row[props.prop] }}</span>
          </template>
        </el-table-column>
      </template>
    </multi-fun-table>

    <table-pagination :size="total" :cur-page="pageNumber" @backData="getPagination"></table-pagination>
  </div>
</template>

<script>
import common from "@mixins/common.js";
import stardardList from "@mixins/tables/stardardList.js";

//modal
import invokeModal from "@mixins/modal/invokeModal.js";
import BigPicModal from "@components/widgets/BigPicModal.vue";

// image
import images from "@mixins/image.js";

// 引进vue的js
import invoice_form from "./js/invoice_form.js";
export default {
  name: "invoiceForm",
  mixins: [common, stardardList, invokeModal, images, invoice_form],
  components: {
    BigPicModal
  },
  data() {
    var today = [
      new Date(
        moment()
          .subtract(1, "days")
          .format("YYYY-MM-DD 00:00:00")
      ),
      new Date(
        moment()
          .subtract(1, "days")
          .format("YYYY-MM-DD 23:59:59")
      )
    ];
    return {
      fixedCols: 4,
      total: 0,
      //prop-返回数据的字段名称   proisNotInter:true,pNameisNotInter:true,，name-查询字段传参名称    text-显示名称  //initHidden  初始化不显示
      searchList: [
        {
          index: 0,
          type: "select",
          isShow: false,
          name: "reportDimension",
          text: "时间维度",
          value: "day",
          isHandleChange: true,
          options: [
            {
              name: "日报",
              value: "day"
            },
            {
              name: "月报",
              value: "month"
            },
            {
              name: "年报",
              value: "year"
            },
            {
              name: "自定义",
              value: "custom"
            }
          ]
        },
        {
          index: 1,
          format: "yyyy-MM-dd",
          type: "datePicker",
          pickerType: "daterange",
          isShow: false,
          name: "dateFromTo",
          text: "时间区间",
          propName: "statDateFromStr,statDateToStr",
          value: today,
          style: {
            width: "360px"
          }
        }
      ],
      theadsInfo: [
        // { index: 0, isShow: false, prop: 'reno', text: '序号', width: 64 },
        {
          index: 1,
          isShow: false,
          prop: "statDateDisplay",
          text: "日期",
          sortable: true,
          minWidth: 80
        },
        {
          index: 2,
          isShow: false,
          prop: "parkName",
          text: "停车场",
          sortable: true,
          minWidth: 60
        },
        {
          index: 3,
          isShow: false,
          prop: "billCount",
          text: "交易流水总数量",
          sortable: true,
          minWidth: 60
        },
        {
          index: 4,
          isShow: false,
          prop: "invoiceCount",
          text: "开票流水次数",
          sortable: true,
          minWidth: 60
        },
        {
          index: 5,
          isShow: false,
          prop: "invoiceTotal",
          text: "开票流水总金额",
          sortable: true,
          minWidth: 60
        }
      ],
      tbodysInfo: []
    };
  }
};
</script>

<style lang="less" scoped>
.ModalBody {
  padding: 20px 35px;

  .HeadMSG {
    display: flex;
    margin-bottom: 10px;

    li:first-child {
      margin-right: 20px;
    }
  }
}
</style>
